package com.cari.oa.service;

import java.sql.Timestamp;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cari.oa.dao.BaseDao;
import com.cari.oa.dao.OARepositoryDao;
import com.cari.oa.domain.OARepositoryEntity;

@Service
@Transactional(rollbackFor = Exception.class)
public class OARepositoryService extends BaseService<OARepositoryEntity> {

	@Resource
	private OARepositoryDao oARepositoryDao;
	@Override
	public BaseDao<OARepositoryEntity> getDao() {
		return oARepositoryDao;
	}

	@Transactional(readOnly = true)
	public List<OARepositoryEntity> getPage(String title, String content, String creator, 
			Timestamp beginTime, Timestamp endTime, Integer page, Integer size){
		return oARepositoryDao.getPage(title, content, creator, beginTime, endTime, page, size);
	}
	
	@Transactional(readOnly = true)
	public long getCount(String title, String content,  String creator, 
			Timestamp beginTime, Timestamp endTime){
		return oARepositoryDao.getCount(title, content, creator, beginTime, endTime);
	}
}
